package com.ruoyi.system.config;

import com.ruoyi.system.interceptor.LoginUserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: TODO
 * @Author: jsj
 * @Date: 2022/8/23
 */
@Configuration
public class loginWebConfig implements WebMvcConfigurer {
    @Autowired
    LoginUserInterceptor loginUserInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // WebMvcConfigurer.super.addInterceptors(registry);
        registry.addInterceptor(loginUserInterceptor).addPathPatterns("/**")
        .excludePathPatterns(
                //"/redis/single/login_page",
                // "/redis/single/system1",
                // "/redis/single/system2",
                // "/redis/single/detection",

                "/**/*.html",
                "/**/*.js",
                "/**/*.css",
                "/**/*.woff",
                "/**/*.ttf"
        );
    }
}
